package com.aura.bookshop.service.impl;

import com.aura.bookshop.entity.Book;
import com.aura.bookshop.mapper.BookMapper;
import com.aura.bookshop.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    BookMapper bookmapper;

    @Override
    public List<Book> queryAll() {
        List<Book> books = bookmapper.queryAll();
        return books;
    }

    @Override
    public int delete(int bid) {
        int delete = bookmapper.delete(bid);
        return delete;
    }

    @Override
    public int add(Book book) {
        int add = bookmapper.add(book);

        return add;
    }
}
